<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <base href="<%=basePath%>">
	<title>永川软件园人才网招聘平台</title>
	<meta http-equiv="X-UA-Compatible" content="IE=10;IE=9;IE=8;IE=7;IE=EDGE">
	<meta name="keywords" content="永川软件园人才网,永川软件园人才网" />
	<meta name="description" content="永川软件园人才网" />
	<link href="favicon.ico" type="image/x-icon" rel="shortcut icon">
	<link rel="stylesheet" type="text/css" href="css/style.css?v1.0">
	<script src="js/jquery.js" type="text/javascript"></script>
	<script type="text/javascript" src="js/jquery_002.js"></script>
	<script type="text/javascript" src="js/core.js"></script>
</head>
<body id="login_bg" style="">
	<div class="login_wrapper">
		<div class="login_header">
        	<a href=""><img src="images/logo_white.png" alt="永川软件园人才网招聘" height="62" width="285"></a>
            <div style="margin-left: -15.1885px;" id="cloud_s"><img src="images/cloud_s.png" alt="cloud" height="52" width="81"></div>
            <div style="margin-left: 15.1885px;" id="cloud_m"><img src="images/cloud_m.png" alt="cloud" height="95" width="136"></div>
        </div>
        
    	<input type="hidden" id="resubmitToken" value="69f196c6c9994b8dbfa83c7683d428bc">		
		<div class="login_box">
        	<form id="loginForm">
        		<ul class="register_radio clearfix">
		            <li>
		            	找工作
		              	<input id="findWork"  type="radio" value="0" name="jobType"> 
		            </li>
		            <li>
		           	           招人
		              	<input id="findPeople" type="radio" value="1" name="jobType"> 
		            </li>
		        </ul> 
            	<input type="text" id="email" name="email" tabindex="1" placeholder="请输入常用邮箱地址">
                <span class="error" style="display:none;" id="beError"></span>
                <input type="password" id="password" name="password" tabindex="2" placeholder="请输入密码">
            	<label class="fl registerJianJu" for="checkbox">
            		<input type="checkbox" id="checkbox" name="checkbox" checked="" class="checkbox valid">我已阅读并同意<a href="privacy.jsp" target="_blank">《永川软件园人才网用户协议》</a>
           		</label>
                <input type="submit" id="submitLogin" value="注     册">
                <input type="hidden" id="callback" name="callback" value="">
                <input type="hidden" id="authType" name="authType" value="">
                <input type="hidden" id="signature" name="signature" value="">
                <input type="hidden" id="timestamp" name="timestamp" value="">
            </form>
            <div class="login_right">
            	<div>已有永川软件园人才网帐号</div>
            	<a href="login.jsp" class="registor_now">直接登录</a>
            </div>
        </div>
        <div class="login_box_btm"></div>
    </div>
    <jsp:include page="jump.jsp" flush="true"/> 
    <script type="text/javascript">
    $(document).ready(function(e) {
    	$('.register_radio li input').click(function(e){
    		$(this).parent('li').addClass('current').append('<em></em>').siblings().removeClass('current').find('em').remove();
    	});
    	
    	$('#email').focus(function(){
    		$('#beError').hide();
    	});
    	//验证表单
    	 $("#loginForm").validate({
   	        rules: {
   	        	jobType:{
   	        		required: true
   	        	},
	    	   	email: {
	    	    	required: true,
	    	    	email: true,
	    	    	maxlength:100
	    	   	},
	    	   	password: {
	    	    	required: true,
	    	    	rangelength: [6,16]
	    	   	},
	    	   	checkbox:{required:true}
	    	},
	    	messages: {
	    		jobType:{
   	        		required:"请选择使用永川软件园人才网的目的"
   	        	},
	    	 	email: {
	    	    	required: "请输入常用邮箱地址",
	    	    	email: "请输入有效的邮箱地址，如：touche@jrq.cn.com",
	    	    	maxlength:"请输入100字以内的邮箱地址"
	    	   	},
	    	   	password: {
	    	    	required: "请输入密码", 
	    	    	rangelength: "请输入6-16位密码，字母区分大小写"
	    	   	},
	    	   	checkbox: {
	    	    	required: "请接受永川软件园人才网用户协议"
	    	   	}
	    	},
	    	errorPlacement:function(label, element){/* 
	    		if(element.attr("type") == "radio"){
	    			label.insertAfter($(element).parents('ul')).css('marginTop','-20px');
	    		}else if(element.attr("type") == "checkbox"){
	    			label.inserresult.contenttAfter($(element).parent()).css('clear','left');
	    		}else{
	    			label.insertAfter(element);
	    		} */			    		
	    		/*modify nancy*/
	    		if(element.attr("type") == "radio"){
	    			label.insertAfter($(element).
	    					parents('ul')).css('marginTop','-20px');
	    		}else if(element.attr("type") == "checkbox"){
	    			label.insertAfter($(element).parent()).css('clear','left');
	    		}else{
	    			label.insertAfter(element);
	    		};	
	    	},
	    	submitHandler:function(form){
				var email = $("#email").val();
				var password = $("#password").val();
				var balance = "";
				if($("#findWork").is(":checked")){
					balance = $("#findWork").val();
				}
    			if($("#findPeople").is(":checked")){
    				balance = $("#findPeople").val();
    			}
	            $.ajax({  
	               type : 'post',  
	               url : 'user_register',  
	               dataType : 'json',  
	               data :  {"balance":balance,"username":email,"password":password},
	          	   success : function (result) {
		        	   if(result.errcode=="40001"){
	                    	$('#beError').text('').show();
		               		$("#beError").html("注册失败，请重新注册！");
		               		return;
		               }
	              	   if(result.errcode=="40012"){
	              	   		$('#beError').text('').show();
	              	   		$("#beError").html("注册失败，邮箱已被注册！");
	              	   		return;
		               }
	              	   if(result.errcode=="0"){
	              	   		var date = new Date();
	              	   		date.setTime(date.getTime() + (3 * 24 * 60 * 60 * 1000));//一天后失效
			                $.cookie("jrqUserName", email, { path: '/', expires: date });
			                //当注册成功根据不同的类型跳转到不同的操作
			                if(balance==1){
			                  window.location.href="bindStep1.jsp";
			                }else{
			                  window.location.href="emailCheck.jsp";
			                }
	              	   	    
	              	   	 
		               }
	               },  
	               error : function () {  
	                    $('#beError').text('').show();
		               	$("#beError").html("接口连接异常，给您带来的不便还请谅解！");
	               }  
	           });   
	        }  
    	});
    });
    
    </script>


<div id="cboxOverlay" style="display: none;"></div>
<div id="colorbox" class="" role="dialog" tabindex="-1"
	style="display: none;">
	<div id="cboxWrapper">
		<div>
			<div id="cboxTopLeft" style="float: left;"></div>
			<div id="cboxTopCenter" style="float: left;"></div>
			<div id="cboxTopRight" style="float: left;"></div>
		</div>
		<div style="clear: left;">
			<div id="cboxMiddleLeft" style="float: left;"></div>
			<div id="cboxContent" style="float: left;">
				<div id="cboxTitle" style="float: left;"></div>
				<div id="cboxCurrent" style="float: left;"></div>
				<button type="button" id="cboxPrevious"></button>
				<button type="button" id="cboxNext"></button>
				<button id="cboxSlideshow"></button>
				<div id="cboxLoadingOverlay" style="float: left;"></div>
				<div id="cboxLoadingGraphic" style="float: left;"></div>
			</div>
			<div id="cboxMiddleRight" style="float: left;"></div>
		</div>
		<div style="clear: left;">
			<div id="cboxBottomLeft" style="float: left;"></div>
			<div id="cboxBottomCenter" style="float: left;"></div>
			<div id="cboxBottomRight" style="float: left;"></div>
		</div>
	</div>
	<div
		style="position: absolute; width: 9999px; visibility: hidden; display: none;"></div>
</div>
</body>
</html>